<?php

class Model_Products_Dislikeproduct extends Zend_Db_Table_Abstract {

	protected $_name = 'products_v1_dislike';
	
	public function getDislikeproduct( $idDislike){
		
		$row = $this->fetchRow("`id_dislike` = ". $idDislike);
		if(!$row) return false;
		return $row->toArray();		
		
		}
		
	public function addDislikeproduct( $codeProduct , $shop , $date){
		
		$data = array(
			
         "code_product" =>  $codeProduct ,
         "shop" =>  $shop ,
         "date" =>  $date 
	
			);
		$this->insert($data);
		
		}
		
	public function updateDislikeproduct(  $idDislike ,  $codeProduct , $shop , $date){
		$data = array(
			
         "code_product" =>  $codeProduct ,
         "shop" =>  $shop ,
         "date" =>  $date 
	
			);
			
		$this->update($data,"`id_dislike` = ". $idDislike);
		}
		
	public function deleteDislikeproduct( $idDislike){
		
		$this->delete("`id_dislike` = ". $idDislike);
		
		}	
	
	public function listAll(){
		
		$rows =$this->fetchAll("1","id_dislike DESC ");
		if(!$rows) return false;
		return $rows->toArray();			
		
		}	
}


?>